package developer.zyk.ability.knowledge.common;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Objects;

/**
 * @author zhangyongkang
 * @time 2025/5/16 17:34
 * @description
 */
@Getter
@AllArgsConstructor
public enum KnowledgeTypeEnum {
    STRUCT("struct"),//结构化
    UNSTRUCTURED("unstructured")//非结构化
    ;
    private final String type;

    public static KnowledgeTypeEnum queryByType(String type) {
        for (KnowledgeTypeEnum value : values()) {
            if (Objects.equals(value.getType(), type)) {
                return value;
            }
        }
        throw new UnsupportedOperationException("不支持的知识库类型:" + type);
    }
}
